Re: [SQL] Using the IN predicate in an UPDATE... - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] Using the IN predicate in an UPDATE...
Date
Msg-id l03110700b24f63bf94e4@[194.90.105.28]
Whole thread Raw
In response to Re: [SQL] Using the IN predicate in an UPDATE...  (Thomas Good <tomg@admin.nrnet.org>)
List pgsql-sql
At 14:37 +0200 on 15/10/98, Thomas Good wrote:


> > Am I missing something here or is this the same as:
> > UPDATE table1 SET id = 2 WHERE id = 1;
> > ??
> >  Les Mikesell
> >    les@mcs.com
>
> 3) Les,  What are ya, some kinda smarta**?  Yeah, somebody was missing
> something, but it weren't you...  ;-)

Hmmm. Are you sure? The original query you presented had different
semantics. It meant "If the recnum has any occurence with id=1, change all
its occurences (even those with id=17) to id=2".

That was the reason why I suggested an "exists" query instead. The above is
only equivalent when each recnum has only one id.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



pgsql-sql by date:

Previous
From: Vladimir Litovka
Date:
Subject: RE: [SQL] Is this BUG or FEATURE?
Next
From: "Michel \\'ZioBudda\\' Morelli"
Date:
Subject: NULL DATE